package com.booksys.examination.service.impl;

import com.booksys.examination.entity.User;
import com.booksys.examination.mappers.LoginUserMapper;
import com.booksys.examination.service.LoginUserService;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import javax.annotation.Resource;

/**
 * @author Administrator
 * @date 2019-08-14 11:24
 */
@Service
public class LoginUserServiceImpl implements LoginUserService {
    @Resource
    private LoginUserMapper loginUserMapper;
    @Override
    public User findUserWithNmPw(String loginName, String password) {
        if (StringUtils.isEmpty(loginName) || StringUtils.isEmpty(password)){
            return null;
        }else if ("".equals(loginName) || "".equals(password))
        {
            return null;
        }
        return loginUserMapper.selectUser(loginName,password);
    }
}
